package com.kgc.chapter01.vars

object Test2 {
  def main(args: Array[String]): Unit = {
    //printResult(100)

    printResult(-50)

  }

  def getAStringMaybe(num: Int): Option[String] = {
    if ( num >= 0 ) Some("A positive number!")
    else None
  }

  def printResult(num: Int) = {
    getAStringMaybe(num) match {
      case Some(str) => println(str)
      case None => println("No string!")
    }
  }

}
